#!/bin/sh
PATH=/usr/sbin/:/usr/bin:/bin:$PATH
export PATH
date
cd /webs/sks-keyservers.net/
curl -s http://sks-keyservers.net/status/ip.php > ip.txt
curl -s http://sks-keyservers.net/status/ip6.php > ip6.txt
curl -s http://sks-keyservers.net/status/ip-v1.php > ip-v1.txt
curl -s http://sks-keyservers.net/status/srv.php > srv.txt
curl -s http://sks-keyservers.net/status/tls.php > tls.txt

if [ -n "`cat ip.txt`" ] && [ -n "`cat ip6.txt`" ] && [ -n "`cat ip-v1.txt`" ]; then
	(cat zonetpl | sed -e "s/XXXXXXXXX/`date +%Y%m%d%H`/"; cat ip.txt; cat ip6.txt; cat ip-v1.txt; cat srv.txt; cat tls.txt) > /var/bind/pri/sks-keyservers.net.zone
	/usr/sbin/rndc reload 2>&1
fi;
